//
//  ZGLLoginZZView.m
//  Faker
//
//  Created by dllo on 15/11/10.
//  Copyright © 2015年 dllo. All rights reserved.
//
#import <AVOSCloud/AVOSCloud.h>
#import "ZGLLoginCZView.h"
@interface ZGLLoginCZView()<UITextFieldDelegate>
@property(nonatomic, retain)UITextField *name;
@end
@implementation ZGLLoginCZView
- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor redColor];
        
        UILabel *nameLab = [[UILabel alloc]initWithFrame:CGRectMake(0, 80, 80, 40)];
        nameLab.text = @"用户名: ";
        nameLab.textAlignment = NSTextAlignmentRight;
        [self addSubview:nameLab];
        
        _name = [[UITextField alloc]initWithFrame:CGRectMake(100*ScaleX, 80, 180, 40)];
        _name.placeholder = @"请输入用户名";
        _name.borderStyle = 3;
        _name.backgroundColor = [UIColor lightGrayColor];
        _name.keyboardType = UIKeyboardTypeDefault;
        [_name becomeFirstResponder];
        _name.delegate = self;
        [self addSubview:_name];
        
        UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
        button.frame = CGRectMake(120*ScaleX, 200, 40, 20);
        [button setTitle:@"重置" forState:UIControlStateNormal];
        [self addSubview:button];
        [button addTarget:self action:@selector(click) forControlEvents:UIControlEventTouchUpInside];
    }
    return self;
}

- (void)click{
    
}

- (BOOL)textFieldShouldReturn:(UITextField *)textField{
    [textField resignFirstResponder];
    return YES;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
